package com.qf.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect    // 代表在当前类配置切面
public class MyAdvice {

    // 声名切入点表达式
    @Pointcut(value = "execution(* com.qf.service.impl.*.*(..))")
    public void myPointcut(){}

    // 配置切入方式，前置，后置，环绕，异常，最终
    @AfterReturning(value = "myPointcut()",returning = "result")
    public void afterReturning(JoinPoint jp , Object result){
        System.out.println("我是后置增强!!!返回结果为:" + result);
    }
}
